package com.webRepo.zhengze;

import java.util.Arrays;


public class PartentDemo {
	
	public static void testDemo(){
		String src="我...我我...要要要...要要要学...学学学..软软..软..软软...件件";
		src=src.replaceAll("\\.", "");
	 System.out.println(src);
		src=src.replaceAll("(.)\\1+", "$1");
		System.out.println(src);
	}
	public static void test2(){
		String temp = "23.168.1.200  192.10.10.10    3.3.50.3  10.0.0.1";
		temp=temp.replaceAll("(\\d+)", "00$1");//全部加0
		temp=temp.replaceAll("0*(\\d{3})","$1");//对于00192这种情况 改成192
		System.out.println(temp);
		String[] ips = temp.split(" +");
		Arrays.sort(ips);
		for(String ip :ips){
			System.out.println(ip.replaceAll("0*(\\d+)", "$1"));//前面去0
		}
	}
	
	public static void main(String[] args) {
		testDemo();
	}
}
